IF (Qt5Core_FOUND)
  FIND_PACKAGE( Qt5Test REQUIRED )

  INCLUDE_DIRECTORIES(${Qt5Test_INCLUDE_DIRS})
  ADD_DEFINITIONS(${Qt5Test_DEFINITIONS})
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Test_EXECUTABLE_COMPILE_FLAGS}")

  SET (TEST_LIBRARIES ${Qt5Test_LIBRARIES})
ENDIF()

macro(add_unittest DESCRIPTION)
    add_test(NAME "${DESCRIPTION}"
             WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
             COMMAND ${ARGN}
    )
endmacro()


ADD_SUBDIRECTORY(cmdline_tester)
ADD_SUBDIRECTORY(parser)
ADD_SUBDIRECTORY(scanner)
ADD_SUBDIRECTORY(qobjecthelper)
ADD_SUBDIRECTORY(serializer)
